﻿@using MoreLinq
@using Domain.Entidades

 
   <div class="cabecalho" id="cabecalho" name="cabecalho">
        <img src="~/Imagens/Cabecalho/logo.png" class="logo_img" id="logo_img"></img>
    
    </div>


    <nav id='cssmenu'>
        <div id="logo" class="logo"></div>
        <div id="head-mobile"></div>
        <div class="button"></div>
        


        <ul>
            

           @foreach (var item in ((IEnumerable<VW_menu>)ViewBag.menu).Where(x => x.men_status==1).DistinctBy(x => x.men_codigo))
            {
                <li @if (item.men_link == "#")
                    {<text> class="li_sub" </text>
                    } @if (item.men_descricao == "Menu")
                      {<text> class="li_sub" </text>
                      }>


                    <a href=@item.men_link>
                        @if (@item.men_image_caminho != "#")
                        {
                            <img src="@item.men_image_caminho"/>}
                        @item.men_descricao


                    </a>

                    @if (item.sub_codigo != -1)
                    {

                        <ul>
                            @foreach (var item2 in ((IEnumerable<VW_menu>)ViewBag.menu).Where(h => h.men_codigo == item.men_codigo && h.sub_status==1))

                            {
                                <li>
                                    <a href='@item2.sub_link' target='@item2.sub_target'>
                                        @if (@item2.sub_imagem_caminho != "#")
                                        {
                                            <img src="@item2.sub_imagem_caminho" border="0px"/>
                                        } @item2.sub_descricao.ToString()
                                    </a>

                                </li>

                            }
                        </ul>
                    }



                </li>



            }
        </ul>
    </nav>

